import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
    history: createWebHistory(),
    routes: [
        {
            path: '/Home',
            component: () => import('../components/Home.vue')
        },
        {
            path: '/TypeList',
            component: () => import('../components/TypeList.vue'),
            children: [
                {
                    path:  'Detail/:id',
                    name: 'shangpin',
                    component: () => import('../components/Detail.vue'),
                    props: true
                },
            ]
        },
        {
            path: '/About',
            component: () => import('../components/About.vue')
        },
        {
            path: '/',
            redirect: '/home'
        }
    ]
})

export default router